<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>QxOrm: eos::portable_oarchive Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo_qxorm.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">QxOrm
   &#160;<span id="projectnumber">1.4.3</span>
   </div>
   <div id="projectbrief">C++ Object Relational Mapping library</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('classeos_1_1portable__oarchive.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-methods">Private Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">eos::portable_oarchive Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="eos::portable_oarchive" -->
<p>Portable binary output archive using little endian format.  
 <a href="classeos_1_1portable__oarchive.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="portable__oarchive_8hpp_source.html">portable_oarchive.hpp</a>&gt;</code></p>

<p><a href="classeos_1_1portable__oarchive-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structeos_1_1portable__oarchive_1_1dummy.html">dummy</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;class T &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">boost::disable_if<br class="typebreak"/>
&lt; boost::is_arithmetic&lt; T &gt;<br class="typebreak"/>
 &gt;::type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classeos_1_1portable__oarchive.html#a25d4c741775b5b654b056a67389e8738">save</a> (const T &amp;t, <a class="el" href="structeos_1_1portable__oarchive_1_1dummy.html">dummy</a>&lt; 1 &gt;=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default fall through for non-arithmetic types (ie. strings)  <a href="#a25d4c741775b5b654b056a67389e8738"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1portable__oarchive.html#aff9742091dfbe8cea0d1f3aaab6f0fcf">save</a> (const bool &amp;b)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Saving bool directly.  <a href="#aff9742091dfbe8cea0d1f3aaab6f0fcf"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">boost::enable_if<br class="typebreak"/>
&lt; boost::is_integral&lt; T &gt;<br class="typebreak"/>
 &gt;::type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classeos_1_1portable__oarchive.html#a6f6f1f41ba76cc8bd8ba2e5d25fd503e">save</a> (const T &amp;t, <a class="el" href="structeos_1_1portable__oarchive_1_1dummy.html">dummy</a>&lt; 2 &gt;=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Save integer types.  <a href="#a6f6f1f41ba76cc8bd8ba2e5d25fd503e"></a><br/></td></tr>
<tr><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr><td class="memTemplItemLeft" align="right" valign="top">boost::enable_if<br class="typebreak"/>
&lt; boost::is_floating_point&lt; T &gt;<br class="typebreak"/>
 &gt;::type&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classeos_1_1portable__oarchive.html#a15ed045c75c9ddb143f55873aaadc899">save</a> (const T &amp;t, <a class="el" href="structeos_1_1portable__oarchive_1_1dummy.html">dummy</a>&lt; 3 &gt;=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Save floating point types.  <a href="#a15ed045c75c9ddb143f55873aaadc899"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1portable__oarchive.html#a548abbe3f9adcdb95262aa517d40b983">portable_oarchive</a> (std::ostream &amp;os, unsigned flags=0)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">always construct on a stream using ios::binary mode!  <a href="#a548abbe3f9adcdb95262aa517d40b983"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classeos_1_1portable__oarchive.html#abaa4e80bbd50a1f31ed64efbec7ca215">save_signed_char</a> (const signed char &amp;c)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Portable binary output archive using little endian format. </p>
<p>This archive addresses integer size, endianness and floating point types so that data can be transferred across different systems. The archive consists primarily of three different save implementations for integral types, floating point types and string types. Those functions are templates and use enable_if to be correctly selected for overloading.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>The class is based on the portable binary example by Robert Ramey and uses Beman Dawes endian library plus fp_utilities by Johan Rade.</dd>
<dd>
Robert Ramey changed his example in boost 1.36 and no longer inherits from binary_oarchive_impl but goes down to basic_binary_oprimitive!? </dd></dl>

<p>Definition at line <a class="el" href="portable__oarchive_8hpp_source.html#l00143">143</a> of file <a class="el" href="portable__oarchive_8hpp_source.html">portable_oarchive.hpp</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a548abbe3f9adcdb95262aa517d40b983"></a><!-- doxytag: member="eos::portable_oarchive::portable_oarchive" ref="a548abbe3f9adcdb95262aa517d40b983" args="(std::ostream &amp;os, unsigned flags=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">eos::portable_oarchive::portable_oarchive </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>os</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>flags</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>always construct on a stream using ios::binary mode! </p>

<p>Definition at line <a class="el" href="portable__oarchive_8hpp_source.html#l00259">259</a> of file <a class="el" href="portable__oarchive_8hpp_source.html">portable_oarchive.hpp</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a25d4c741775b5b654b056a67389e8738"></a><!-- doxytag: member="eos::portable_oarchive::save" ref="a25d4c741775b5b654b056a67389e8738" args="(const T &amp;t, dummy&lt; 1 &gt;=0)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">boost::disable_if&lt;boost::is_arithmetic&lt;T&gt; &gt;::type eos::portable_oarchive::save </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structeos_1_1portable__oarchive_1_1dummy.html">dummy</a>&lt; 1 &gt;&#160;</td>
          <td class="paramname"> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default fall through for non-arithmetic types (ie. strings) </p>

<p>Definition at line <a class="el" href="portable__oarchive_8hpp_source.html#l00164">164</a> of file <a class="el" href="portable__oarchive_8hpp_source.html">portable_oarchive.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="aff9742091dfbe8cea0d1f3aaab6f0fcf"></a><!-- doxytag: member="eos::portable_oarchive::save" ref="aff9742091dfbe8cea0d1f3aaab6f0fcf" args="(const bool &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void eos::portable_oarchive::save </td>
          <td>(</td>
          <td class="paramtype">const bool &amp;&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Saving bool directly. </p>

<p>Definition at line <a class="el" href="portable__oarchive_8hpp_source.html#l00170">170</a> of file <a class="el" href="portable__oarchive_8hpp_source.html">portable_oarchive.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="a6f6f1f41ba76cc8bd8ba2e5d25fd503e"></a><!-- doxytag: member="eos::portable_oarchive::save" ref="a6f6f1f41ba76cc8bd8ba2e5d25fd503e" args="(const T &amp;t, dummy&lt; 2 &gt;=0)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">boost::enable_if&lt;boost::is_integral&lt;T&gt; &gt;::type eos::portable_oarchive::save </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structeos_1_1portable__oarchive_1_1dummy.html">dummy</a>&lt; 2 &gt;&#160;</td>
          <td class="paramname"> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Save integer types. </p>
<p>First we save the size information ie. the number of bytes that hold the actual data. We subsequently transform the data using store_little_endian and store non-zero bytes to the stream. </p>

<p>Definition at line <a class="el" href="portable__oarchive_8hpp_source.html#l00185">185</a> of file <a class="el" href="portable__oarchive_8hpp_source.html">portable_oarchive.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="a15ed045c75c9ddb143f55873aaadc899"></a><!-- doxytag: member="eos::portable_oarchive::save" ref="a15ed045c75c9ddb143f55873aaadc899" args="(const T &amp;t, dummy&lt; 3 &gt;=0)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">boost::enable_if&lt;boost::is_floating_point&lt;T&gt; &gt;::type eos::portable_oarchive::save </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structeos_1_1portable__oarchive_1_1dummy.html">dummy</a>&lt; 3 &gt;&#160;</td>
          <td class="paramname"> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Save floating point types. </p>
<p>We simply rely on fp_traits to extract the bit pattern into an (unsigned) integral type and store that into the stream.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>by Johan Rade (author of the floating point utilities library): Be warned that the math::detail::fp_traits&lt;T&gt;::type::get_bits() function is *not* guaranteed to give you all bits of the floating point number. It will give you all bits if and only if there is an integer type that has the same size as the floating point you are copying from. It will not give you all bits for double if there is no uint64_t. It will not give you all bits for long double if sizeof(long double) &gt; 8 or there is no uint64_t.</dd></dl>
<p>The member fp_traits&lt;T&gt;::type::coverage will tell you whether all bits are copied. This is a typedef for either math::detail::all_bits or math::detail::not_all_bits.</p>
<p>If the function does not copy all bits, then it will copy the most significant bits. So if you serialize and deserialize the way you describe, and fp_traits&lt;T&gt;::type::coverage is math::detail::not_all_bits, then your floating point numbers will be truncated. This will introduce small rounding off errors.</p>
<dl class="note"><dt><b>Note:</b></dt><dd>treat nan values using fpclassify </dd></dl>

<p>Definition at line <a class="el" href="portable__oarchive_8hpp_source.html#l00237">237</a> of file <a class="el" href="portable__oarchive_8hpp_source.html">portable_oarchive.hpp</a>.</p>

</div>
</div>
<a class="anchor" id="abaa4e80bbd50a1f31ed64efbec7ca215"></a><!-- doxytag: member="eos::portable_oarchive::save_signed_char" ref="abaa4e80bbd50a1f31ed64efbec7ca215" args="(const signed char &amp;c)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void eos::portable_oarchive::save_signed_char </td>
          <td>(</td>
          <td class="paramtype">const signed char &amp;&#160;</td>
          <td class="paramname"><em>c</em></td><td>)</td>
          <td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="portable__oarchive_8hpp_source.html#l00154">154</a> of file <a class="el" href="portable__oarchive_8hpp_source.html">portable_oarchive.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>C:/Dvlp/_Perso/QxOrm/include/QxSerialize/boost/portable_binary/<a class="el" href="portable__oarchive_8hpp_source.html">portable_oarchive.hpp</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceeos.html">eos</a>      </li>
      <li class="navelem"><a class="el" href="classeos_1_1portable__oarchive.html">portable_oarchive</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Sun Dec 11 2016 13:41:11 for QxOrm by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
